\documentclass[format=sigconf]{acmart}
\usepackage[utf8]{inputenc}

\def\inputfig#1{\input #1}
\def\inputtex#1{\input #1}
\def\inputal#1{\input #1}
\def\inputcode#1{\input #1}

\inputtex{logos.tex}
\inputtex{refmacros.tex}
\inputtex{other-macros.tex}

\acmConference[ELS’21]{the 14th European Lisp Symposium}{May 03--04
  2021}{Online, Everywhere}
%\acmISBN{978-2-9557474-3-8}
\acmISBN{}
\acmDOI{10.5281/zenodo.4709958}
\startPage{1}
\setcopyright{rightsretained}
\copyrightyear{2021}

\begin{document}
\title{Call-site optimization for Common Lisp}

\author{Robert Strandh}
\email{robert.strandh@u-bordeaux.fr}

\affiliation{
  \institution{LaBRI, University of Bordeaux}
  \streetaddress{351 cours de la libération}
  \city{Talence}
  \country{France}}

\begin{abstract}
A function call in a language such as \commonlisp{} can be fairly
costly.  Not only is an indirection required so that a redefinition of
the callee can take effect for subsequent calls, but several features
of \commonlisp{} can have an even greater impact on the performance of
function calls.  The presence of optional parameters and/or keyword
parameters requires some non-trivial argument parsing in the callee.
And when the callee is a generic function, it must invoke the
discriminating function in order to dispatch to the effective
method that is determined by the arguments.  Restrictions such as the
required boxing of all arguments can make function calls slow for
full-word integer and floating-point numbers.

In this paper, we propose a very general technique for improving the
performance of function calls in \commonlisp{}.  Our technique is
based on \emph{call-site optimization}, meaning that each call site
can be automatically customized for the callee according to the number
and the types of the arguments being transmitted to the callee.  Our
technique is based on the call site being implemented as an
unconditional jump to a \emph{trampoline snippet} that is generated by
the callee according to information provided by the caller with
respect to the arguments.  Thus, the callee is able to fully customize
the call, thereby avoiding many costly steps of a function call such
as indirections, boxing/unboxing, argument parsing, and more.
\end{abstract}

\begin{CCSXML}
<ccs2012>
<concept>
<concept_id>10011007.10010940.10011003.10011002</concept_id>
<concept_desc>Software and its engineering~Software performance</concept_desc>
<concept_significance>500</concept_significance>
</concept>
<concept>
<concept_id>10011007.10011006.10011041.10011048</concept_id>
<concept_desc>Software and its engineering~Runtime environments</concept_desc>
<concept_significance>500</concept_significance>
</concept>
</ccs2012>
\end{CCSXML}

\ccsdesc[500]{Software and its engineering~Software performance}
\ccsdesc[500]{Software and its engineering~Runtime environments}

\keywords{\commonlisp{}, Performance, Call-site optimization}

\maketitle


\inputtex{sec-introduction.tex}
\inputtex{sec-previous.tex}
\inputtex{sec-sicl.tex}
\inputtex{sec-our-method.tex}
\inputtex{sec-benefits.tex}
\inputtex{sec-disadvantages.tex}
\inputtex{sec-conclusions.tex}
\inputtex{sec-acknowledgments.tex}

\bibliographystyle{plainnat}
%\bibliographystyle{abbrv}
\bibliography{call-site-optimization}
\end{document}
